package com.ruoyi.energize.controller;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.energize.domain.WdzDepartments;
import com.ruoyi.energize.util.GetGenderData;

import java.util.List;

public class Test {
    public static void main(String[] args) {
     /*   String a=",S_226657";
        System.out.println(",".trim(a));*/
       /* GetGenderData getGenderData=new GetGenderData();
        String departmentsString=getGenderData.getDepartments();
        stringToJsonobject(departmentsString);*/
    }
    public static void stringToJsonobject(String stringJson){
        JSONObject jsonObject = (JSONObject) JSONObject.parse(stringJson);
        System.out.println(jsonObject.toString());
        //获取 msg
        System.out.println(jsonObject.get("result"));
        if(jsonObject.get("result").equals("SUCCESS")){
            JSONArray jsonArrayData = jsonObject.getJSONArray("data");

            List<WdzDepartments> wdzDepartments = jsonArrayData.toJavaList(WdzDepartments.class);
            if (wdzDepartments.size()>0) {//证明存在门店
                //使用list批量插入到万店掌门店列表中去

            }
        }
    }
}
